package com.coder.zzq.smartshow.toastAndSnackbar;

import android.view.Gravity;
import android.view.View;
import android.widget.Toast;

import com.coder.zzq.smartshow.toast.SmartToast;
import com.my.screenadapter.Base.BaseActivity;
import com.my.screenadapter.R;

/**
 * 作者 https://mp.weixin.qq.com/s?__biz=MzA5MzI3NjE2MA==&mid=2650241980&idx=1&sn=6bd6353f93d4190912fc826c0f1cfa5a&chksm=88638ad3bf1403c56666b9f6f23477cf0085e54605c085543b15cb67333def78f4fe517109d8&mpshare=1&scene=23&srcid=12162yqungTJMtSykPJdEG4V#rd
 * github https://github.com/the-pig-of-jungle/SmartShow
 *
 */
public class TestToastActivity extends BaseActivity {
    private Toast mToast;
    @Override
    protected void init() {
        mToast = Toast.makeText(this,"",Toast.LENGTH_SHORT);
    }

    @Override
    protected int initLayoutId() {
        return R.layout.activity_test_toast;
    }

    public void onNormalShowFirstClick(View view) {
        mToast.setText("Showing!");
        mToast.show();
    }

    public void onShowClick(View view) {
        //默认位置
        SmartToast.show("苹果！");
    }

    public void onAnotherShow(View view) {
        //默认位置
        SmartToast.show("香蕉！");
    }

    public void onShowInCenterClick(View view) {
        SmartToast.showInCenter("桔子！");
    }

    public void onShowAtTopClick(View view) {
        SmartToast.showAtTop("芒果！");
    }


    public void onShowAtSomeLocationClick(View view) {
        //左上角，x,y偏移量均为10dp
        SmartToast.showAtLocation("荔枝！", Gravity.LEFT | Gravity.TOP,10,10);
    }

}
